using System;
using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using Newtonsoft.Json;

{{#models}}
{{#model}}
namespace {{modelPackage}} {

  /// <summary>
  /// {{description}}
  /// </summary>
  [DataContract]
  public class {{classname}}{{#parent}} : {{{.}}}{{/parent}} {
    {{#vars}}
    /// <summary>
    /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{{description}}}
    /// </summary>{{#description}}
    /// <value>{{{.}}}</value>{{/description}}
    [DataMember(Name="{{baseName}}", EmitDefaultValue=false)]
    [JsonProperty(PropertyName = "{{baseName}}")]
    {{#deprecated}}
    [Obsolete]
    {{/deprecated}}
    public {{{dataType}}} {{name}} { get; set; }

    {{/vars}}

    /// <summary>
    /// Get the string presentation of the object
    /// </summary>
    /// <returns>String presentation of the object</returns>
    public override string ToString()  {
      var sb = new StringBuilder();
      sb.Append("class {{classname}} {\n");
      {{#vars}}
      sb.Append("  {{name}}: ").Append({{name}}).Append("\n");
      {{/vars}}
      sb.Append("}\n");
      return sb.ToString();
    }

    /// <summary>
    /// Get the JSON string presentation of the object
    /// </summary>
    /// <returns>JSON string presentation of the object</returns>
    public {{#parent}} new {{/parent}}string ToJson() {
      return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
    }

}
{{/model}}
{{/models}}
}
